Problem Note 58175: The CATX function can produce unexpected results when used in DS2
The CATX function can produce unexpected results when used within DS2. The CATX function incorrectly appends the delimiter to a missing value. This behavior differs from the documented behavior of the CATX function, which states that blank items do not produce delimiters at the beginning or the end of the result, nor do blank items produce multiple consecutive delimiters.
The example code below illustrates the problem.
proc ds2;
data _null_;
dcl varchar(100) "X";
dcl varchar(100) "Y";
dcl varchar(100) "Z";
dcl varchar(100) "NEWVAR";
method run();
"X"='TEST';
"Y" = ' ';
"Z"='TEST';
"NEWVAR" = catx( '*' , "X","Y" , "Z" );
put "NEWVAR"=;
end;
enddata;
run;
quit;
The output of the PUT statement below shows that the CATX function incorrectly lists consecutive delimiters:
The delimiter should not be appended to the value because the value of Y is missing.
Click the Hot Fix tab in this note to access the hot fix for this issue.
Operating System and Release Information
SAS System | Base SAS | HP-UX IPF | 9.4 TS1M0 | 9.4 TS1M4 |
64-bit Enabled Solaris | 9.4 TS1M0 | 9.4 TS1M4 |
64-bit Enabled AIX | 9.4 TS1M0 | 9.4 TS1M4 |
Windows 7 Professional x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Windows 7 Enterprise x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2012 Std | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2008 R2 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 10 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8 Pro x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft® Windows® for x64 | 9.4 TS1M0 | 9.4 TS1M4 |
z/OS 64-bit | 9.4 TS1M0 | 9.4 TS1M4 |
z/OS | 9.4 TS1M0 | 9.4 TS1M4 |
Linux for x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Solaris for x64 | 9.4 TS1M0 | 9.4 TS1M4 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
When used within DS2, the CATX function can incorrectly list the delimiter after a missing value. The delimiter should be omitted after a missing value.
Type: | Problem Note |
Priority: | high |
Date Modified: | 2017-06-07 09:50:25 |
Date Created: | 2016-05-05 15:48:39 |